

Array.prototype.myfill = function(value, num = 0, end) {
    end = end || this.length
    for(let i = start; i < end; i++) {
        this[i] = value
    }
    return this
}

let arr = [1,2,3,4,5].fill(0,1,4)
console.log(arr);